package com.imooc.dianping.common;

/**
 * 统一返回结果封装
 */
public class CommonRes {

    // 返回状态
    private String status;

    //返回的数据
    // success 返回json报文 error 返回null+错误信息
    private Object data;


    // 响应正常sccess
    public static CommonRes create(Object result) {
        return create(result, "success");
    }

    public static CommonRes create(Object result, String status) {
        CommonRes commonRes = new CommonRes();
        commonRes.setData(result);
        commonRes.setStatus(status);
        return commonRes;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
